package MyProject2;

public class demo1 {
    public static void main(String[] args) {
        Node node = new Node(5,null);
        MyArrayList.add(1,node);
        MyArrayList.add(3,node);
        MyArrayList.add(4,node);

        Node p = MyArrayList.sort(node);

        Node node1 = new Node(4,null);
        MyArrayList.add(10,node1);
        MyArrayList.add(100,node1);
        MyArrayList.add(19,node1);
        MyArrayList.add(20,node1);
        MyArrayList.add(30,node1);

        Node pp = MyArrayList.sort(node1);

        Node ppp = MyArrayList.merge(p,pp);
        while (ppp != null){
            System.out.println(ppp.value);
            ppp = ppp.next;
        }


    }
}
